//
//  HWquanliaoDeTableViewCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2020/12/14.
//  Copyright © 2020 Chendaobin. All rights reserved.
//

#import "HWquanliaoDeTableViewCell.h"

@implementation HWquanliaoDeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    
    self.jiaruButon = [UIButton buttonWithType:UIButtonTypeCustom];
    self.jiaruButon.frame = CGRectMake(kScreenW -40-20, 14+10, 40, 24);
    [self.jiaruButon setTitle:@"加入" forState:UIControlStateNormal];
    [self.jiaruButon setTitleColor:RGB(255, 255, 255) forState:UIControlStateNormal];
    self.jiaruButon.backgroundColor = [UIColor bm_colorGradientChangeWithSizeView:self.jiaruButon];
    self.jiaruButon.layer.cornerRadius = 12;
    self.jiaruButon.layer.masksToBounds = YES;
    self.jiaruButon.titleLabel.font = [UIFont systemFontOfSize:11];
    
    [self.contentView addSubview:self.jiaruButon];
    
    self.icoimahView.layer.cornerRadius = 10;
    self.icoimahView.backgroundColor = RGB(236, 236, 236);
    self.icoimahView.layer.masksToBounds = YES;
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


-(void)setTuijindataModel:(HWqunliaoModel *)tuijindataModel {
    
    _tuijindataModel = tuijindataModel;
    
    [self.icoimahView sd_setImageWithURL:[NSURL URLWithString:tuijindataModel.icon] placeholderImage:nil];
    self.zixunLabel.text = [NSString stringWithFormat:@"%@",tuijindataModel.name];
    
    self.tieziLabel.text = [NSString stringWithFormat:@"消息 %@    人数 %@",tuijindataModel.xiaoxi,tuijindataModel.sum];
    
    
    
    if ([tuijindataModel.join   isEqualToString:@"1"]) {
        
          NSString *yijianru =  [HWjianzhiduiObject keylocalization:@"已加入"];
         
        
          [self.jiaruButon setTitle:@"已加入" forState:UIControlStateNormal];
        [self.jiaruButon setTitle:yijianru forState:UIControlStateNormal];
        
         
    } else {
        
        
          [self.jiaruButon setTitle:@"加入" forState:UIControlStateNormal];
         NSString *yijianru =  [HWjianzhiduiObject keylocalization:@"加入"];
         [self.jiaruButon setTitle:yijianru forState:UIControlStateNormal];
        
    }
    
    
    
    
    
    
    
    
}

@end
